package my.util;

public class NonBase2Printer
{

	public static void PrintByte(byte theByte)
	{	
		for (int i = 0; i < 31; i++)
		{
			if ((theByte & (1 << i)) != 0)
			{
				System.out.print("1 ");
			} else
			{
				System.out.print("0 ");
			}
		}
		System.out.println("");
	}
	
	public static void PrintHexNumber(byte [] theByte)
	{
		for (byte aByte : theByte)
		{
			PrintHex(aByte);
		}
		System.out.println("");
	}
	
	public static void PrintHex(byte theByte)
	{	
		char c = ' ';
		switch ((int)theByte)
		{
		case 0: c = '0'; break;
		case 1: c = '1'; break;
		case 2: c = '2'; break;
		case 3: c = '3'; break;
		case 4: c = '4'; break;
		case 5: c = '5'; break;
		case 6: c = '6'; break;
		case 7: c = '7'; break;
		case 8: c = '8'; break;
		case 9: c = '9'; break;
		case 10: c = 'A'; break;
		case 11: c = 'B'; break;
		case 12: c = 'C'; break;
		case 13: c = 'D'; break;
		case 14: c = 'E'; break;
		case 15: c = 'F'; break;
		}
		System.out.print(c);
	}
}
